package 题目集.预处理;

//https://vjudge.net.cn/contest/613789#problem/F

import java.util.Arrays;
import java.util.Scanner;

/**
 * 预处理数组
 */
public class 节约用电 {
    static int[] left;  //每个点距离它左侧的距离
    static int[] right; //每个点距离它右侧的距离
    static int[] origin;
    static int n;
    static int m;
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        m=sc.nextInt();
        left=new int[n];
        right=new int[n];
        origin=new int[n];
        for (int i = 0; i < origin.length; i++) {
            origin[i]=sc.nextInt();
        }
        Arrays.sort(origin);
        int len=n-1;
        for (int i = 1; i < len; i++) {
            left[i]=origin[i]-origin[i-1];
            right[i]=origin[i+1]-origin[i];
        }
        int res=0;
        for (int i = 1; i < len; i++) {
            int d = left[i] + right[i];
            if (d <=m){
                res++;
                left[i+1]=d;
            }
        }
        System.out.println(res);
    }
}
